--[[/**
-- * 
 * 联合自己的召唤物,发动攻击
-- *
-- */]]

---@class BuffEffect581100 : BaseBuffEffect
BuffEffect581100 = ClientFight.CreateClass("BuffEffect581100", ClientFight.BaseBuffEffect)
local t = BuffEffect581100

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local target = buff.addParameters[1];
    local team = fight.teams[buff.target.teamIndex];
    local b = table.contains(buff.target.totalSign.signs,buff.buffBean.f_BuffEffectValue[1]);
    local attackTarget = target;
    if (not b) then
    attackTarget = nil;
    end
    local fighters = clone(team.fighters);
    for i = 1, i < table.getn(fighters) do
    local fighter = fighters[i];
    if (not fighter:isSummons()) then
    goto continue;
    end
    if (fighter.summonsCreater ~= buff.target) then
    goto continue;
    end
    local normalAttack = fighter.normalAttack;
    if (normalAttack == nil) then
    goto continue;
    end
    t:triggerSkill(fight,fighter,attackTarget,normalAttack.skillId);
        ::continue::
    end
    local logTarget = attackTarget;
    local s = logTarget == nil and " 随机" or logTarget.fighterId .. "";
    SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff"
    .. buff.modelId .. " 触发小精灵联合攻击, 攻击目标: " .. s);
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);

end

t.New()